<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>组合选择器</title>
  <style>
    /* 示例1.元素选择器 */
    h1,h2,h3,h4,h5,h6 {
      /* 居中显示所有的标题元素前颜色为白色，背景颜色为黑色。 */
      text-align: center;
      color: white;  
      background-color: black;
    }

    /* 组合使用 */ 
    .demo1,#demo2,a[title="演示3"],input[name~="demo3"] {
      padding: 20px;
      color: red;
      background-color: cornflowerblue;
      border: 2px solid black;
      border-radius: 5px;
    }
    </style>
</head>
<body>
    <h1>标题1</h1>
    <h2>标题2</h2>
    <h3>标题3</h3>
    <hr>
    <span class="demo1">演示1</span> 
    <span id="demo2">演示2</span> 
    <a href="https://weiyigeek.top" title="演示3">演示3</a> <br> <br> <br>
    <label for="demo3">用户名：</label><input type="text" id="demo3" name="demo3" value="演示4"> <br>
    <hr>
    <p>The strongly emphasized word in this paragraph is<strong>red</strong>.</p>
    <h2 class="h2p">This subhead is also <p>red.</p></h2>
    <!--只有下面这一行会受到影响h2 里面的 stong-->
    <h2>The strongly emphasized word in this subhead is<strong>blue</strong>.</h2>

    <ul>
      <li><strong>无序</strong></li>
      <li>无序2</li>
      <li>无序3</li>
    </ul>
</body>
</html>